export enum BlockType {
  AIR = 0,
  GRASS = 1,
  DIRT = 2,
  STONE = 3,
  LOG = 4,
  PLANKS = 5,
  COAL_ORE = 6,
  LAVA = 7,
  FURNACE = 8,
  TORCH = 9,
  CRAFTING_TABLE = 10,
  // 新增方块类型
  SAND = 11,
  SANDSTONE = 12,
  GLASS = 13,
  IRON_ORE = 14,
  GOLD_ORE = 15,
  DIAMOND_ORE = 16,
  WATER = 17,
  OBSIDIAN = 18,
  REDSTONE_WIRE = 19,
  REDSTONE_TORCH = 20,
  COBBLESTONE = 21,
  GRAVEL = 22,
  CLAY = 23,
  BRICK = 24,
  SNOW = 25,
  
  // 树木相关方块
  LEAVES = 26,
  BIRCH_LOG = 27,
  SPRUCE_LOG = 28,
  BIRCH_LEAVES = 29,
  SPRUCE_LEAVES = 30,
  WET_LEAVES = 31, // 含水树叶
  SAPLING = 32,
  
  // 新增物品和方块
  ENDER_PEARL = 33,
  COAL_ITEM = 34, // 煤炭物品（区别于煤矿方块）
  IRON_INGOT = 35, // 铁锭
  GOLD_INGOT = 36, // 金锭
  DIAMOND = 37, // 钻石
  RAW_IRON = 38, // 粗铁
  RAW_GOLD = 39, // 粗金
  
  // 生物掉落物品
  LEATHER = 40, // 皮革
  RAW_BEEF = 41, // 生牛肉
  RAW_PORKCHOP = 42, // 生猪肉
  WOOL = 43, // 羊毛
  MUTTON = 44, // 羊肉
  ROTTEN_FLESH = 45, // 腐肉
  BONE = 46, // 骨头
  ARROW = 47, // 箭
  BOW = 48, // 弓
  
  // 工具和武器
  STICK = 49, // 木棍
  WOODEN_SWORD = 50, // 木剑
  STONE_SWORD = 51, // 石剑
  IRON_SWORD = 52, // 铁剑
  GOLD_SWORD = 53, // 金剑
  DIAMOND_SWORD = 54, // 钻石剑
  DIAMOND_HOE = 55, // 钻石锄头
  SHEARS = 56, // 剪刀
  FISHING_ROD = 57, // 钓鱼竿
  FLINT_AND_STEEL = 58, // 打火石
  COMPASS = 59, // 指南针
  CLOCK = 60, // 时钟
  BUCKET = 61, // 桶
  CROSSBOW = 62, // 弩
  SHIELD = 63, // 盾牌
  
  // 材料
  STRING = 64, // 线
  FLINT = 65, // 燧石
  REDSTONE_DUST = 66, // 红石粉
  TRIPWIRE_HOOK = 67, // 绊线钩
  SLIME_BALL = 68, // 史莱姆球
  NETHER_QUARTZ = 69, // 下界石英
  FEATHER = 70, // 羽毛
  BOOK = 71, // 书
  
  // 护甲
  LEATHER_HELMET = 72, // 皮革头盔
  LEATHER_CHESTPLATE = 73, // 皮革胸甲
  LEATHER_LEGGINGS = 74, // 皮革护腿
  LEATHER_BOOTS = 75, // 皮革靴子
  IRON_HELMET = 76, // 铁头盔
  IRON_CHESTPLATE = 77, // 铁胸甲
  IRON_LEGGINGS = 78, // 铁护腿
  IRON_BOOTS = 79, // 铁靴子
  GOLD_HELMET = 80, // 金头盔
  GOLD_CHESTPLATE = 81, // 金胸甲
  GOLD_LEGGINGS = 82, // 金护腿
  GOLD_BOOTS = 83, // 金靴子
  DIAMOND_HELMET = 84, // 钻石头盔
  DIAMOND_CHESTPLATE = 85, // 钻石胸甲
  DIAMOND_LEGGINGS = 86, // 钻石护腿
  DIAMOND_BOOTS = 87, // 钻石靴子
  
  // 建筑方块
  WOODEN_STAIRS = 88, // 木楼梯
  STONE_STAIRS = 89, // 石楼梯
  WOODEN_SLAB = 90, // 木台阶
  STONE_SLAB = 91, // 石台阶
  WOODEN_DOOR = 92, // 木门
  IRON_DOOR = 93, // 铁门
  WOODEN_TRAPDOOR = 94, // 木活板门
  IRON_TRAPDOOR = 95, // 铁活板门
  WOODEN_FENCE = 96, // 木栅栏
  GLASS_PANE = 97, // 玻璃板
  IRON_BARS = 98, // 铁栏杆
  BOOKSHELF = 99, // 书架
  
  // 红石相关
  REDSTONE_REPEATER = 100, // 红石中继器
  REDSTONE_COMPARATOR = 101, // 红石比较器
  PISTON = 102, // 活塞
  STICKY_PISTON = 103, // 粘性活塞
  POWERED_RAIL = 104, // 动力铁轨
  DETECTOR_RAIL = 105, // 探测铁轨
  STONE_PRESSURE_PLATE = 106, // 石质压力板
  
  // 交通工具
  MINECART = 107, // 矿车
  BOAT = 108, // 船
  
  // 更多工具
  COAL = 109, // 煤炭物品
  CHARCOAL = 110, // 木炭
  PAPER = 111, // 纸
  WOODEN_PICKAXE = 112, // 木镐
  STONE_PICKAXE = 113, // 石镐
  IRON_PICKAXE = 114, // 铁镐
  GOLD_PICKAXE = 115, // 金镐
  DIAMOND_PICKAXE = 116, // 钻石镐
  WOODEN_AXE = 117, // 木斧
  STONE_AXE = 118, // 石斧
  IRON_AXE = 119, // 铁斧
  GOLD_AXE = 120, // 金斧
  DIAMOND_AXE = 121, // 钻石斧
  WOODEN_SHOVEL = 122, // 木锹
  STONE_SHOVEL = 123, // 石锹
  IRON_SHOVEL = 124, // 铁锹
  GOLD_SHOVEL = 125, // 金锹
  DIAMOND_SHOVEL = 126, // 钻石锹
  WOODEN_HOE = 127, // 木锄
  STONE_HOE = 128, // 石锄
  IRON_HOE = 129, // 铁锄
  GOLD_HOE = 130, // 金锄
  
  // 更多方块
  CHEST = 131, // 箱子
  RAIL = 132, // 铁轨
  WOODEN_PRESSURE_PLATE = 133, // 木质压力板
  LEVER = 134, // 拉杆
  BUTTON = 135 // 按钮
}

export interface BlockData {
  type: BlockType;
  metadata?: number;
}

export enum ToolType {
  NONE = 'none',
  PICKAXE = 'pickaxe',
  SHOVEL = 'shovel',
  AXE = 'axe',
  HOE = 'hoe'
}

export interface ItemDrop {
  type: BlockType;
  count: number;
  chance: number; // 0-1
}

export interface BlockProperties {
  hardness: number; // 破坏难度 (0-10)
  tool?: ToolType; // 需要的工具类型
  drops: ItemDrop[]; // 掉落物品
  transparent: boolean;
  lightLevel: number;
  redstoneConductive?: boolean; // 是否导电
  flammable?: boolean; // 是否可燃
  liquid?: boolean; // 是否为液体
}

export interface Block {
  id: BlockType;
  name: string;
  solid: boolean;
  properties: BlockProperties;
  textures: {
    top?: string;
    bottom?: string;
    sides?: string;
    front?: string;
    back?: string;
    left?: string;
    right?: string;
  };
}

// 向后兼容的属性访问器
export interface LegacyBlock extends Block {
  transparent: boolean;
  lightLevel: number;
}